﻿using DataAccessLayer;
using System.Collections.Generic;
using System.Data;

namespace BussinessLogicLayer
{
    public class BLL_User
    {
        public static List<USER> LoadAll()
        {
            var listUser = new List<USER>();
            DataTable dt = DAO_User.LoadAll();
            if (dt != null && dt.Rows.Count > 0)
            {
                foreach (DataRow row in dt.Rows)
                {
                    listUser.Add(new USER
                    {
                        USER_ID = row["USER_ID"].ToString(),
                        USER_FIRST_NAME = row["USER_FIRST_NAME"].ToString().Trim(),
                        USER_LAST_NAME = row["USER_LAST_NAME"].ToString().Trim()
                    });
                }
            }

            return listUser;
        }
    }
}
